import pymysql

# Connect to the database
connection = pymysql.connect(host='127.0.0.1',
                             user='root',
                             password='1234',
                             database='soft',
                             port=3306,
                             )
cursor=connection.cursor() #获取数据库的操作游标

cursor.execute("insert into student values ('芜湖',123,3)") #执行SQL语句，要进行操作的内容写成SQL语句
cursor.execute('select * from plane;')

connection.commit() #保存数据
results = cursor.fetchall() #能拿到查询到的所有数据
print('查询到的结果\t',results)

cursor.close()
connection.close()